package com.ruanmou.vip.rabbitmq.demo.topic;

import com.rabbitmq.client.Channel;
import com.ruanmou.vip.rabbitmq.demo.route.PBCConfig;
import com.ruanmou.vip.rabbitmq.demo.util.RabbitMQUtil;

/**
 * 欢迎同学们来到牧码人教育
 *
 * @Classname RouteSend
 * @Description TODO
 * @Date 2020-3-7 14:47
 * @Created by Gerry
 */
public class TopicSend implements TopicConfig {
    public static void main(String[] args) throws Exception {
        Channel channel = RabbitMQUtil.getConnection().createChannel();
        channel.exchangeDeclare(EXCHANGE_NAME, TOPIC_TYPE);
        channel.basicPublish(EXCHANGE_NAME, "user.insert.d.a.d.d.d", null, "发布订阅模式推送消息".getBytes());
        System.out.println("消息推送完成");
        channel.close();
    }
}
